from PyQt4 import QtGui,QtCore
from ftllibs.FTL import CHAMPS as CHAMPS
from ftllibs.FTL import ITEMS as ITEMS
from ftllibs.FTL import BuildDS as BuildDS
from ftllibs.ui.UI_ChampDisplay import UI_ChampDisplay
from ftllibs.ui.UI_SlotItemDisplay import UI_SlotItemDisplay
import math

class CompareTab(QtGui.QWidget):
    def __init__(self,parent=None):
        super(CompareTab,self).__init__()
        self.Slot1=SlotDisplay(1)
        self.Slot2=SlotDisplay(2)
        self.Slot3=SlotDisplay(3)
        self.Slot4=SlotDisplay(4)
        self.StatTab = QtGui.QTabWidget()
        self.StatTab.setTabsClosable(False)
        self.StatTab.setMovable(True)
        self.GraphicalTab=CompareGraphical(self)
        self.NumericalTab=CompareNumerical(self)
        self.StatTab.addTab(self.NumericalTab,"Numerical")
        self.StatTab.addTab(self.GraphicalTab,"Graphical")
        self.MasterLayout=QtGui.QGridLayout()
        self.setLayout(self.MasterLayout)
        self.initUI()

    def initUI(self):
        self.LoadSlotButton=QtGui.QPushButton('LoadMe')
        self.LoadSlotButton.clicked.connect(self.loadIntoSlotDialog)
#        self.MasterLayout.addWidget(self.LoadSlotButton)
        self.SlotLayout=QtGui.QGridLayout()
        self.Slot1LoadButton=QtGui.QPushButton('Load')
        self.Slot1ClearButton=QtGui.QPushButton('Clear')
        self.Slot1Layout=QtGui.QGridLayout()
        self.Slot1Layout.addWidget(self.Slot1,0,0,1,2)
        self.Slot1Layout.addWidget(self.Slot1LoadButton,1,0,1,1)
        self.Slot1Layout.addWidget(self.Slot1ClearButton,1,1,1,1)
        self.Slot1Layout.setColumnStretch(2,1)
        self.Slot1LoadButton.clicked.connect(self.LoadSlot1)
        self.Slot1ClearButton.clicked.connect(self.ClearSlot2)
        self.Slot2LoadButton=QtGui.QPushButton('Load')
        self.Slot2ClearButton=QtGui.QPushButton('Clear')
        self.Slot2Layout=QtGui.QGridLayout()
        self.Slot2Layout.addWidget(self.Slot2,0,0,1,2)
        self.Slot2Layout.addWidget(self.Slot2LoadButton,1,0,1,1)
        self.Slot2Layout.addWidget(self.Slot2ClearButton,1,1,1,1)
        self.Slot2Layout.setColumnStretch(2,1)
        self.Slot2LoadButton.clicked.connect(self.LoadSlot2)
        self.Slot2ClearButton.clicked.connect(self.ClearSlot2)

        self.Slot3LoadButton=QtGui.QPushButton('Load')
        self.Slot3ClearButton=QtGui.QPushButton('Clear')
        self.Slot3Layout=QtGui.QGridLayout()
        self.Slot3Layout.addWidget(self.Slot3,0,0,1,2)
        self.Slot3Layout.addWidget(self.Slot3LoadButton,1,0,1,1)
        self.Slot3Layout.addWidget(self.Slot3ClearButton,1,1,1,1)
        self.Slot3Layout.setColumnStretch(2,1)
        self.Slot3LoadButton.clicked.connect(self.LoadSlot3)
        self.Slot3ClearButton.clicked.connect(self.ClearSlot3)

        self.Slot4LoadButton=QtGui.QPushButton('Load')
        self.Slot4ClearButton=QtGui.QPushButton('Clear')
        self.Slot4Layout=QtGui.QGridLayout()
        self.Slot4Layout.addWidget(self.Slot4,0,0,1,2)
        self.Slot4Layout.addWidget(self.Slot4LoadButton,1,0,1,1)
        self.Slot4Layout.addWidget(self.Slot4ClearButton,1,1,1,1)
        self.Slot4Layout.setColumnStretch(2,1)
        self.Slot4LoadButton.clicked.connect(self.LoadSlot4)
        self.Slot4ClearButton.clicked.connect(self.ClearSlot4)

        self.SlotLayout.addLayout(self.Slot1Layout,0,0,1,1)
        self.SlotLayout.addLayout(self.Slot2Layout,1,0,1,1)
        self.SlotLayout.addLayout(self.Slot3Layout,2,0,1,1)
        self.SlotLayout.addLayout(self.Slot4Layout,3,0,1,1)
        
        self.MasterLayout.addLayout(self.SlotLayout,0,0,1,1)
        self.MasterLayout.addWidget(self.StatTab,0,1,1,1)

    def LoadSlot1(self):
        dlg = loadSlotDialog(self)
        dlg.exec_()
        champ,build,ok=dlg.getReturn()
        self.Slot1.SetChampS(champ,build)
        self.GraphicalTab.UpdateGraph()
        self.NumericalTab.UpdateStatsC1()

    def ClearSlot1(self):
        pass

    def LoadSlot2(self):
        dlg = loadSlotDialog(self)
        dlg.exec_()
        champ,build,ok=dlg.getReturn()
        print champ
        self.Slot2.SetChampS(champ,build)
        self.GraphicalTab.UpdateGraph()
        self.NumericalTab.UpdateStatsC2()

    def ClearSlot2(self):
        pass

    def LoadSlot3(self):
        dlg = loadSlotDialog(self)
        dlg.exec_()
        champ,build,ok=dlg.getReturn()
        print champ
        self.Slot3.SetChampS(champ,build)
        self.GraphicalTab.UpdateGraph()
        self.NumericalTab.UpdateStatsC3()

    def ClearSlot3(self):
        pass

    def LoadSlot4(self):
        dlg = loadSlotDialog(self)
        dlg.exec_()
        champ,build,ok=dlg.getReturn()
        print champ
        self.Slot4.SetChampS(champ,build)
        self.GraphicalTab.UpdateGraph()
        self.NumericalTab.UpdateStatsC4()
                
    def ClearSlot4(self):
        pass

    def loadIntoSlotDialog(self,slot):
        pass

class SlotDisplay(QtGui.QWidget):
    def __init__(self,SlotID,parent=None):
        super(SlotDisplay,self).__init__()
        self.ChampID=None
        self.BID=None
        self.Champ=None
        self.setFixedSize(400,200)
        self.SlotID=SlotID
        self.MasterLayout=QtGui.QGridLayout()
        self.setLayout(self.MasterLayout)
        self.BuildName=QtGui.QLabel('ss')
        self.SlotChampDisplay=UI_ChampDisplay(self)
        print "SlotDisplay: SlotChampDisplay: ",self.SlotChampDisplay
        self.SlotItemDisplay=UI_SlotItemDisplay()
        self.MasterLayout.addWidget(self.SlotChampDisplay,0,0,1,1)
        self.MasterLayout.addWidget(self.BuildName,0,1,1,1)
        self.MasterLayout.addWidget(self.SlotItemDisplay,1,0,1,2)
#        self.SlotChampDisplay.SetChamp(78)

    def SetChampS(self,ChampID,BID):
        self.ChampID=int(ChampID)
        self.Champ=CHAMPS.GetChampCopy(self.ChampID)
        buildmodel = BuildDS.GetBuildDataModel(self.ChampID)
        build = buildmodel.loadBuild(BID)
        for i in range(1,7):
            if build['Item%s' % (i)] == 'None':
                continue
            else:
                self.Champ.AddItem(i,build['Item%s' % (i)])
        self.SlotChampDisplay.SetChamp(self.Champ.ID)
        self.SlotItemDisplay.SetChamp(self.Champ)
        self.update()

#    def SetBuild(self,)

    def paintEvent(self,e):
        painter = QtGui.QPainter(self)
        pen = QtGui.QPen()
        pen.setWidth(6)
        if self.SlotID == 1:
            pen.setColor(QtGui.QColor(200,0,0))
        if self.SlotID == 2:
            pen.setColor(QtGui.QColor(0,200,0))
        if self.SlotID == 3:
            pen.setColor(QtGui.QColor(0,0,200))
        if self.SlotID == 4:
            pen.setColor(QtGui.QColor(150,150,0))
        painter.setPen(pen)
        painter.drawRect(self.rect())


class loadSlotDialog(QtGui.QDialog):
    def __init__(self,parent=None):
        super(loadSlotDialog,self).__init__()
        self.MasterLayout=QtGui.QGridLayout()
        self.ChampLabel=QtGui.QLabel('Select a Champion:')
        self.ChampComboBox=QtGui.QComboBox()
        self.ChampComboBox.addItem('Choose a Champ')
        self.BuildLabel=QtGui.QLabel('Select a Build:')
        self.BuildComboBox=QtGui.QComboBox()
        self.BuildComboBox.addItem('Select a Champ First')
        self.LoadButton=QtGui.QPushButton('Load')
        self.CancelButton=QtGui.QPushButton('Cancel')
        self.LoadButton.clicked.connect(self.LoadClicked)
        self.CancelButton.clicked.connect(self.CancelClicked)
        self.MasterLayout.addWidget(self.ChampLabel)
        self.MasterLayout.addWidget(self.ChampComboBox)
        self.MasterLayout.addWidget(self.BuildLabel)
        self.MasterLayout.addWidget(self.BuildComboBox)
        self.MasterLayout.addWidget(self.LoadButton)
        self.MasterLayout.addWidget(self.CancelButton)
        self.setLayout(self.MasterLayout)
        self.model=None
        self.champ=None
        self.build=None
        self.PopulateChampComboBox()
        self.ChampComboBox.currentIndexChanged[str].connect(self.PopulateBuildComboBox)
        self.BuildComboBox.currentIndexChanged[int].connect(self.SetBID)

    def SetBID(self,pos):
        if self.model == None:
            self.build=None
            return
        else:
            self.build=self.model.getBID(pos)
            return

    def PopulateChampComboBox(self):
        for i in BuildDS.GetAvailableChampSaves():
            print i
            self.ChampComboBox.addItem(CHAMPS.GetChampName(i))
    def PopulateBuildComboBox(self,ChampID):
        print "populatebuildcombobox: ",ChampID
        if ChampID == "Select a Champ":
            return
        ChampID = CHAMPS.GetChampID(ChampID)
        self.model=BuildDS.GetBuildDataModel(ChampID)
        self.BuildComboBox.setModel(self.model)
        self.BuildComboBox.update()
        self.update()
        self.champ=ChampID

    def LoadClicked(self):
#        self.champ=CHAMPS.GetChampID(self.ChampComboBox.currentText())
#        self.build=self.BuildComboBox.currentText()
        self.ok = True
        self.close()
        
    def CancelClicked(self):
        self.ok= False
        self.champ=None
        self.build=None
        self.close()

    def getReturn(self):
        return self.champ,self.build,self.ok


class CompareGraphical(QtGui.QWidget):
    def __init__(self,parent=None):
        super(CompareGraphical,self).__init__()
        self.parent = parent
        self.setFixedWidth(700)
        self.initUI()
        

    def initUI(self):
        self.GraphBG1 = QtGui.QPixmap("images/ui/StatsGrid.png")
        self.GraphLines = QtGui.QPixmap(self.GraphBG1)
        self.Champ1Color=QtGui.QColor(200,0,0)
        self.Champ2Color=QtGui.QColor(0,200,0)
        self.Champ3Color=QtGui.QColor(0,0,200)
        self.Champ4Color=QtGui.QColor(150,150,0)
        self.lay = QtGui.QHBoxLayout()
        self.setLayout(self.lay)

    def UpdateGraph(self):
        # Collect Champs from slots
        Champ1 = self.parent.Slot1.Champ
        Champ2 = self.parent.Slot2.Champ
        Champ3 = self.parent.Slot3.Champ
        Champ4 = self.parent.Slot4.Champ
        self.ListOfBuilds = {}
        if not Champ1 == None:
            self.ListOfBuilds[self.Champ1Color]=Champ1
        if not Champ2 == None:
            self.ListOfBuilds[self.Champ2Color]=Champ2
        if not Champ3 == None:
            self.ListOfBuilds[self.Champ3Color]=Champ3
        if not Champ4 == None:
            self.ListOfBuilds[self.Champ4Color]=Champ4
            
        
        # octagon graph
        health_delta = 4000.0 / 216.0
        armor_delta = 400.0 / 216.0
        damage_delta = 400.0 / 216.0
        mana_delta = 4000.0 / 216.0
        resist_delta = 400.0 / 216.0
        power_delta = 400.0 / 216.0
        health_regen_delta = 100.0 / 216.0
        mana_regen_delta = 100.0 / 216.0

        #bar chart
        speed_delta = 500.0 / 140.0
        armor_penetration_delta = 100.0 / 140.0
        life_steal_delta = 100.0 / 140.0
        attack_speed_delta = 2.5 / 140.0
        critical_delta = 100.0 / 140.0
        spell_penetration_delta = 100.0 / 140.0
        spell_vamp_delta = 100.0 / 140.0
        cooldown_reduction_delta = 40.0 / 140.0

        # graph 1
        polygonF = QtGui.QPolygonF()
        BuildNum=1
        x_offset = 343
        y_offset = 267
        self.GraphLines = QtGui.QPixmap(self.GraphBG1)
#        self.GraphLines.fill(QtGui.QColor('transpar))
        painter = QtGui.QPainter(self.GraphLines)
        pen = QtGui.QPen()

        for color,champ in self.ListOfBuilds.iteritems():
            pen.setWidth(3)
            painter.setPen(pen)
            print "GraphItem Loop: Champ: " ,champ
            pen.setColor(color)
            painter.setPen(pen)
            #octagon chart
            health_length = champ.Health/health_delta
            h_y = math.sin(math.radians(247.5)) * health_length + y_offset
            h_x = math.cos(math.radians(247.5)) * health_length + x_offset

            health_regen_length = champ.Health_Regen_per_5_seconds/health_regen_delta
            hr_y = math.sin(math.radians(202.5)) * health_regen_length + y_offset
            hr_x = math.cos(math.radians(202.5)) * health_regen_length + x_offset

            damage_length = champ.Attack_Damage/damage_delta
            d_y = math.sin(math.radians(157.5)) * damage_length + y_offset
            d_x = math.cos(math.radians(157.5)) * damage_length + x_offset

            armor_length = champ.Armor/armor_delta
            a_y = math.sin(math.radians(112.5)) * armor_length + y_offset
            a_x = math.cos(math.radians(112.5)) * armor_length + x_offset

            resist_length = champ.Magic_Resist/resist_delta
            r_y = math.sin(math.radians(67.5)) * resist_length + y_offset
            r_x = math.cos(math.radians(67.5)) * resist_length + x_offset

            power_length = champ.Ability_Power/power_delta
            p_y = math.sin(math.radians(22.5)) * power_length + y_offset
            p_x = math.cos(math.radians(22.5)) * power_length + x_offset

            mana_regen_length = champ.Mana_Regen_per_5_seconds/mana_regen_delta
            mr_y = math.sin(math.radians(337.5)) * mana_regen_length + y_offset
            mr_x = math.cos(math.radians(337.5)) * mana_regen_length + x_offset

            mana_length = champ.Mana/mana_delta
            m_y = math.sin(math.radians(292.5)) * mana_length + y_offset
            m_x = math.cos(math.radians(292.5)) * mana_length + x_offset
            # column chart

            speed_length = champ.Movement_Speed/speed_delta
            armor_penetration_length = champ.Armor_Penetration_Flat/armor_penetration_delta
            life_steal_length=champ.Life_Steal/life_steal_delta
            attack_speed_length =champ.Attack_Speed/attack_speed_delta
            critical_length = champ.Critical_Strike_Chance/critical_delta
            spell_penetration_length = champ.Magic_Penetration_Flat/spell_penetration_delta
            spell_vamp_length = champ.Spell_Vamp/spell_vamp_delta
            cooldown_reduction_length = champ.Cooldown_Reduction/cooldown_reduction_delta

            polygonF.clear()
            polygonF.append(QtCore.QPointF(h_x,h_y))
            polygonF.append(QtCore.QPointF(hr_x,hr_y))
            polygonF.append(QtCore.QPointF(d_x,d_y))
            polygonF.append(QtCore.QPointF(a_x,a_y))
            polygonF.append(QtCore.QPointF(r_x,r_y))
            polygonF.append(QtCore.QPointF(p_x,p_y))
            polygonF.append(QtCore.QPointF(mr_x,mr_y))
            polygonF.append(QtCore.QPointF(m_x,m_y))
            polygonF.append(QtCore.QPointF(h_x,h_y))
            painter.drawPolygon(polygonF)
            # column charts
            # speed
            pen.setWidth(7)
            painter.setPen(pen)
            offx = 20
            offy = 600
            
            painter.drawLine(offx+(8*BuildNum),offy,offx+(8*BuildNum),offy-speed_length)
            painter.drawLine(offx+(8*BuildNum)+55,offy,offx+(8*BuildNum)+55,offy-armor_penetration_length)
            painter.drawLine(offx+(8*BuildNum)+110,offy,offx+(8*BuildNum)+110,offy-life_steal_length)
            painter.drawLine(offx+(8*BuildNum)+165,offy,offx+(8*BuildNum)+165,offy-attack_speed_length)
            painter.drawLine(offx+(8*BuildNum)+220,offy,offx+(8*BuildNum)+220,offy-critical_length)
            painter.drawLine(offx+(8*BuildNum)+275,offy,offx+(8*BuildNum)+275,offy-spell_penetration_length)
            painter.drawLine(offx+(8*BuildNum)+330,offy,offx+(8*BuildNum)+330,offy-spell_vamp_length)
            painter.drawLine(offx+(8*BuildNum)+385,offy,offx+(8*BuildNum)+385,offy-cooldown_reduction_length)
            # print "##### Stats #####",BuildNum,"#########"
            # print "Health: ", health_length * health_delta
            # print "Health Regen: ", health_regen_length * health_regen_delta
            # print "Damage: ",damage_length * damage_delta
            # print "Armor: ",armor_length * armor_delta
            # print "Power: ", power_length * power_delta
            # print "Resist: ",resist_length * resist_delta
            # print "Mana Regen: ",mana_regen_length * mana_regen_delta
            # print "Mana: ", mana_length * mana_delta
            # print "Speed: ", speed_length * speed_delta
            # print "Life Steal ",armor_penetration_length * armor_penetration_delta
            # print "Attack Speed ",attack_speed_length * attack_speed_delta
            # print "Critical ",critical_length * critical_delta
            # print "Spell Pen: ",spell_penetration_length * spell_penetration_delta
            # print "Spell Vamp: ",spell_vamp_length * spell_vamp_delta
            # print "CDR: ",cooldown_reduction_length * cooldown_reduction_delta
            # print "##################"
            print "########### Stats #####",champ.Name,"##############"
            champ.DumpStats()
            print ""
            BuildNum += 1
        painter.end()
        # repaint
        self.update()

    def paintEvent(self,e):
        painter = QtGui.QPainter(self)
        painter.fillRect(self.rect(),QtGui.QColor("#DDAA00"))
#        painter.drawPixmap(0,0,self.GraphBG1)
        painter.drawPixmap(0,0,self.GraphLines)


class CompareNumerical(QtGui.QWidget):
    def __init__(self,parent):
        super(CompareNumerical,self).__init__()
        self.MasterLayout=QtGui.QGridLayout()
        self.MasterLayout.setVerticalSpacing(30)
        self.setLayout(self.MasterLayout)
#        self.Champ=parent.Champ
        self.parent = parent
        self.InitUI()
#        self.UpdateStats()

    def InitUI(self):
        # health
        self.L_Health=QtGui.QVBoxLayout()
        self.LBL_Health=QtGui.QLabel('Health\n')
        self.LE_HealthC1=QtGui.QLineEdit()
        self.LE_HealthC1.setReadOnly(True)
        self.LE_HealthC1.setText('0')
        self.LE_HealthC1.setMaximumWidth(100)
        self.LE_HealthC2=QtGui.QLineEdit()
        self.LE_HealthC2.setReadOnly(True)
        self.LE_HealthC2.setText('0')
        self.LE_HealthC2.setMaximumWidth(100)
        self.LE_HealthC3=QtGui.QLineEdit()
        self.LE_HealthC3.setReadOnly(True)
        self.LE_HealthC3.setText('0')
        self.LE_HealthC3.setMaximumWidth(100)
        self.LE_HealthC4=QtGui.QLineEdit()
        self.LE_HealthC4.setReadOnly(True)
        self.LE_HealthC4.setText('0')
        self.LE_HealthC4.setMaximumWidth(100)
        self.L_Health.addWidget(self.LBL_Health)
        self.L_Health.addWidget(self.LE_HealthC1)
        self.L_Health.addWidget(self.LE_HealthC2)
        self.L_Health.addWidget(self.LE_HealthC3)
        self.L_Health.addWidget(self.LE_HealthC4)
        self.L_Health.addStretch()
        # mana
        self.L_Mana=QtGui.QVBoxLayout()
        self.LBL_Mana=QtGui.QLabel('Mana\n')
        self.LE_ManaC1=QtGui.QLineEdit()
        self.LE_ManaC1.setReadOnly(True)
        self.LE_ManaC1.setText('0')
        self.LE_ManaC1.setMaximumWidth(100)
        self.LE_ManaC2=QtGui.QLineEdit()
        self.LE_ManaC2.setReadOnly(True)
        self.LE_ManaC2.setText('0')
        self.LE_ManaC2.setMaximumWidth(100)
        self.LE_ManaC3=QtGui.QLineEdit()
        self.LE_ManaC3.setReadOnly(True)
        self.LE_ManaC3.setText('0')
        self.LE_ManaC3.setMaximumWidth(100)
        self.LE_ManaC4=QtGui.QLineEdit()
        self.LE_ManaC4.setReadOnly(True)
        self.LE_ManaC4.setText('0')
        self.LE_ManaC4.setMaximumWidth(100)
        
        self.L_Mana.addWidget(self.LBL_Mana)
        self.L_Mana.addWidget(self.LE_ManaC1)
        self.L_Mana.addWidget(self.LE_ManaC2)
        self.L_Mana.addWidget(self.LE_ManaC3)
        self.L_Mana.addWidget(self.LE_ManaC4)
        self.L_Mana.addStretch()
        # Health Regen
        self.L_Health_Regen_per_5_seconds=QtGui.QVBoxLayout()
        self.LBL_Health_Regen_per_5_seconds=QtGui.QLabel('Health Regen\nper 5s (per 1s)')
        self.LE_Health_Regen_per_5_secondsC1=QtGui.QLineEdit()
        self.LE_Health_Regen_per_5_secondsC1.setReadOnly(True)
        self.LE_Health_Regen_per_5_secondsC1.setText('0')
        self.LE_Health_Regen_per_5_secondsC1.setMaximumWidth(100)
        self.LE_Health_Regen_per_5_secondsC2=QtGui.QLineEdit()
        self.LE_Health_Regen_per_5_secondsC2.setReadOnly(True)
        self.LE_Health_Regen_per_5_secondsC2.setText('0')
        self.LE_Health_Regen_per_5_secondsC2.setMaximumWidth(100)
        self.LE_Health_Regen_per_5_secondsC3=QtGui.QLineEdit()
        self.LE_Health_Regen_per_5_secondsC3.setReadOnly(True)
        self.LE_Health_Regen_per_5_secondsC3.setText('0')
        self.LE_Health_Regen_per_5_secondsC3.setMaximumWidth(100)
        self.LE_Health_Regen_per_5_secondsC4=QtGui.QLineEdit()
        self.LE_Health_Regen_per_5_secondsC4.setReadOnly(True)
        self.LE_Health_Regen_per_5_secondsC4.setText('0')
        self.LE_Health_Regen_per_5_secondsC4.setMaximumWidth(100)
        self.L_Health_Regen_per_5_seconds.addWidget(self.LBL_Health_Regen_per_5_seconds)
        self.L_Health_Regen_per_5_seconds.addWidget(self.LE_Health_Regen_per_5_secondsC1)
        self.L_Health_Regen_per_5_seconds.addWidget(self.LE_Health_Regen_per_5_secondsC2)
        self.L_Health_Regen_per_5_seconds.addWidget(self.LE_Health_Regen_per_5_secondsC3)
        self.L_Health_Regen_per_5_seconds.addWidget(self.LE_Health_Regen_per_5_secondsC4)
        self.L_Health_Regen_per_5_seconds.addStretch()
        # Mana Regen
        self.L_Mana_Regen_per_5_seconds=QtGui.QVBoxLayout()
        self.LBL_Mana_Regen_per_5_seconds=QtGui.QLabel('Mana Regen\nper 5s (per 1s)')
        self.LE_Mana_Regen_per_5_secondsC1=QtGui.QLineEdit()
        self.LE_Mana_Regen_per_5_secondsC1.setReadOnly(True)
        self.LE_Mana_Regen_per_5_secondsC1.setText('0')
        self.LE_Mana_Regen_per_5_secondsC1.setMaximumWidth(100)
        self.LE_Mana_Regen_per_5_secondsC2=QtGui.QLineEdit()
        self.LE_Mana_Regen_per_5_secondsC2.setReadOnly(True)
        self.LE_Mana_Regen_per_5_secondsC2.setText('0')
        self.LE_Mana_Regen_per_5_secondsC2.setMaximumWidth(100)
        self.LE_Mana_Regen_per_5_secondsC3=QtGui.QLineEdit()
        self.LE_Mana_Regen_per_5_secondsC3.setReadOnly(True)
        self.LE_Mana_Regen_per_5_secondsC3.setText('0')
        self.LE_Mana_Regen_per_5_secondsC3.setMaximumWidth(100)
        self.LE_Mana_Regen_per_5_secondsC4=QtGui.QLineEdit()
        self.LE_Mana_Regen_per_5_secondsC4.setReadOnly(True)
        self.LE_Mana_Regen_per_5_secondsC4.setText('0')
        self.LE_Mana_Regen_per_5_secondsC4.setMaximumWidth(100)
        self.L_Mana_Regen_per_5_seconds.addWidget(self.LBL_Mana_Regen_per_5_seconds)
        self.L_Mana_Regen_per_5_seconds.addWidget(self.LE_Mana_Regen_per_5_secondsC1)
        self.L_Mana_Regen_per_5_seconds.addWidget(self.LE_Mana_Regen_per_5_secondsC2)
        self.L_Mana_Regen_per_5_seconds.addWidget(self.LE_Mana_Regen_per_5_secondsC3)
        self.L_Mana_Regen_per_5_seconds.addWidget(self.LE_Mana_Regen_per_5_secondsC4)
        self.L_Mana_Regen_per_5_seconds.addStretch()
        # Attack Damage
        self.L_Attack_Damage=QtGui.QVBoxLayout()
        self.LBL_Attack_Damage=QtGui.QLabel('Attack Damage\n')
        self.LE_Attack_DamageC1=QtGui.QLineEdit()
        self.LE_Attack_DamageC1.setReadOnly(True)
        self.LE_Attack_DamageC1.setText('0')
        self.LE_Attack_DamageC1.setMaximumWidth(100)
        self.LE_Attack_DamageC2=QtGui.QLineEdit()
        self.LE_Attack_DamageC2.setReadOnly(True)
        self.LE_Attack_DamageC2.setText('0')
        self.LE_Attack_DamageC2.setMaximumWidth(100)
        self.LE_Attack_DamageC3=QtGui.QLineEdit()
        self.LE_Attack_DamageC3.setReadOnly(True)
        self.LE_Attack_DamageC3.setText('0')
        self.LE_Attack_DamageC3.setMaximumWidth(100)
        self.LE_Attack_DamageC4=QtGui.QLineEdit()
        self.LE_Attack_DamageC4.setReadOnly(True)
        self.LE_Attack_DamageC4.setText('0')
        self.LE_Attack_DamageC4.setMaximumWidth(100)
        
        self.L_Attack_Damage.addWidget(self.LBL_Attack_Damage)
        self.L_Attack_Damage.addWidget(self.LE_Attack_DamageC1)
        self.L_Attack_Damage.addWidget(self.LE_Attack_DamageC2)
        self.L_Attack_Damage.addWidget(self.LE_Attack_DamageC3)
        self.L_Attack_Damage.addWidget(self.LE_Attack_DamageC4)
        self.L_Attack_Damage.addStretch()
        # Armor
        self.L_Armor=QtGui.QVBoxLayout()
        self.LBL_Armor=QtGui.QLabel('Armor\n')
        self.LE_ArmorC1=QtGui.QLineEdit()
        self.LE_ArmorC1.setReadOnly(True)
        self.LE_ArmorC1.setText('0')
        self.LE_ArmorC1.setMaximumWidth(100)
        self.LE_ArmorC2=QtGui.QLineEdit()
        self.LE_ArmorC2.setReadOnly(True)
        self.LE_ArmorC2.setText('0')
        self.LE_ArmorC2.setMaximumWidth(100)
        self.LE_ArmorC3=QtGui.QLineEdit()
        self.LE_ArmorC3.setReadOnly(True)
        self.LE_ArmorC3.setText('0')
        self.LE_ArmorC3.setMaximumWidth(100)
        self.LE_ArmorC4=QtGui.QLineEdit()
        self.LE_ArmorC4.setReadOnly(True)
        self.LE_ArmorC4.setText('0')
        self.LE_ArmorC4.setMaximumWidth(100)
        self.L_Armor.addWidget(self.LBL_Armor)
        self.L_Armor.addWidget(self.LE_ArmorC1)
        self.L_Armor.addWidget(self.LE_ArmorC2)
        self.L_Armor.addWidget(self.LE_ArmorC3)
        self.L_Armor.addWidget(self.LE_ArmorC4)
        self.L_Armor.addStretch()
        # Ability Power
        self.L_Ability_Power=QtGui.QVBoxLayout()
        self.LBL_Ability_Power=QtGui.QLabel('Ability Power\n')
        self.LE_Ability_PowerC1=QtGui.QLineEdit()
        self.LE_Ability_PowerC1.setReadOnly(True)
        self.LE_Ability_PowerC1.setText('0')
        self.LE_Ability_PowerC1.setMaximumWidth(100)
        self.LE_Ability_PowerC2=QtGui.QLineEdit()
        self.LE_Ability_PowerC2.setReadOnly(True)
        self.LE_Ability_PowerC2.setText('0')
        self.LE_Ability_PowerC2.setMaximumWidth(100)
        self.LE_Ability_PowerC3=QtGui.QLineEdit()
        self.LE_Ability_PowerC3.setReadOnly(True)
        self.LE_Ability_PowerC3.setText('0')
        self.LE_Ability_PowerC3.setMaximumWidth(100)
        self.LE_Ability_PowerC4=QtGui.QLineEdit()
        self.LE_Ability_PowerC4.setReadOnly(True)
        self.LE_Ability_PowerC4.setText('0')
        self.LE_Ability_PowerC4.setMaximumWidth(100)
        self.L_Ability_Power.addWidget(self.LBL_Ability_Power)
        self.L_Ability_Power.addWidget(self.LE_Ability_PowerC1)
        self.L_Ability_Power.addWidget(self.LE_Ability_PowerC2)
        self.L_Ability_Power.addWidget(self.LE_Ability_PowerC3)
        self.L_Ability_Power.addWidget(self.LE_Ability_PowerC4)
        self.L_Ability_Power.addStretch()
        # Magic Resist
        self.L_Magic_Resist=QtGui.QVBoxLayout()
        self.LBL_Magic_Resist=QtGui.QLabel('Magic Resist\n')
        self.LE_Magic_ResistC1=QtGui.QLineEdit()
        self.LE_Magic_ResistC1.setReadOnly(True)
        self.LE_Magic_ResistC1.setText('0')
        self.LE_Magic_ResistC1.setMaximumWidth(100)
        self.LE_Magic_ResistC2=QtGui.QLineEdit()
        self.LE_Magic_ResistC2.setReadOnly(True)
        self.LE_Magic_ResistC2.setText('0')
        self.LE_Magic_ResistC2.setMaximumWidth(100)
        self.LE_Magic_ResistC3=QtGui.QLineEdit()
        self.LE_Magic_ResistC3.setReadOnly(True)
        self.LE_Magic_ResistC3.setText('0')
        self.LE_Magic_ResistC3.setMaximumWidth(100)
        self.LE_Magic_ResistC4=QtGui.QLineEdit()
        self.LE_Magic_ResistC4.setReadOnly(True)
        self.LE_Magic_ResistC4.setText('0')
        self.LE_Magic_ResistC4.setMaximumWidth(100)
        
        self.L_Magic_Resist.addWidget(self.LBL_Magic_Resist)
        self.L_Magic_Resist.addWidget(self.LE_Magic_ResistC1)
        self.L_Magic_Resist.addWidget(self.LE_Magic_ResistC2)
        self.L_Magic_Resist.addWidget(self.LE_Magic_ResistC3)
        self.L_Magic_Resist.addWidget(self.LE_Magic_ResistC4)
        self.L_Magic_Resist.addStretch()
        # Movement_speed
        self.L_Movement_Speed=QtGui.QVBoxLayout()
        self.LBL_Movement_Speed=QtGui.QLabel('Movement Speed\n')
        self.LE_Movement_SpeedC1=QtGui.QLineEdit()
        self.LE_Movement_SpeedC1.setReadOnly(True)
        self.LE_Movement_SpeedC1.setText('0')
        self.LE_Movement_SpeedC1.setMaximumWidth(100)
        self.LE_Movement_SpeedC2=QtGui.QLineEdit()
        self.LE_Movement_SpeedC2.setReadOnly(True)
        self.LE_Movement_SpeedC2.setText('0')
        self.LE_Movement_SpeedC2.setMaximumWidth(100)
        self.LE_Movement_SpeedC3=QtGui.QLineEdit()
        self.LE_Movement_SpeedC3.setReadOnly(True)
        self.LE_Movement_SpeedC3.setText('0')
        self.LE_Movement_SpeedC3.setMaximumWidth(100)
        self.LE_Movement_SpeedC4=QtGui.QLineEdit()
        self.LE_Movement_SpeedC4.setReadOnly(True)
        self.LE_Movement_SpeedC4.setText('0')
        self.LE_Movement_SpeedC4.setMaximumWidth(100)
        
        self.L_Movement_Speed.addWidget(self.LBL_Movement_Speed)
        self.L_Movement_Speed.addWidget(self.LE_Movement_SpeedC1)
        self.L_Movement_Speed.addWidget(self.LE_Movement_SpeedC2)
        self.L_Movement_Speed.addWidget(self.LE_Movement_SpeedC3)
        self.L_Movement_Speed.addWidget(self.LE_Movement_SpeedC4)
        self.L_Movement_Speed.addStretch()
        # Attack_Speed
        self.L_Attack_Speed=QtGui.QVBoxLayout()
        self.LBL_Attack_Speed=QtGui.QLabel('Attack Speed\n')
        self.LE_Attack_SpeedC1=QtGui.QLineEdit()
        self.LE_Attack_SpeedC1.setReadOnly(True)
        self.LE_Attack_SpeedC1.setText('0')
        self.LE_Attack_SpeedC1.setMaximumWidth(100)
        self.LE_Attack_SpeedC2=QtGui.QLineEdit()
        self.LE_Attack_SpeedC2.setReadOnly(True)
        self.LE_Attack_SpeedC2.setText('0')
        self.LE_Attack_SpeedC2.setMaximumWidth(100)
        self.LE_Attack_SpeedC3=QtGui.QLineEdit()
        self.LE_Attack_SpeedC3.setReadOnly(True)
        self.LE_Attack_SpeedC3.setText('0')
        self.LE_Attack_SpeedC3.setMaximumWidth(100)
        self.LE_Attack_SpeedC4=QtGui.QLineEdit()
        self.LE_Attack_SpeedC4.setReadOnly(True)
        self.LE_Attack_SpeedC4.setText('0')
        self.LE_Attack_SpeedC4.setMaximumWidth(100)
        self.L_Attack_Speed.addWidget(self.LBL_Attack_Speed)
        self.L_Attack_Speed.addWidget(self.LE_Attack_SpeedC1)
        self.L_Attack_Speed.addWidget(self.LE_Attack_SpeedC2)
        self.L_Attack_Speed.addWidget(self.LE_Attack_SpeedC3)
        self.L_Attack_Speed.addWidget(self.LE_Attack_SpeedC4)
        self.L_Attack_Speed.addStretch()
        # Spell_Vamp
        self.L_Spell_Vamp=QtGui.QVBoxLayout()
        self.LBL_Spell_Vamp=QtGui.QLabel('Spell Vamp\n')
        self.LE_Spell_VampC1=QtGui.QLineEdit()
        self.LE_Spell_VampC1.setReadOnly(True)
        self.LE_Spell_VampC1.setText('0')
        self.LE_Spell_VampC1.setMaximumWidth(100)
        self.LE_Spell_VampC2=QtGui.QLineEdit()
        self.LE_Spell_VampC2.setReadOnly(True)
        self.LE_Spell_VampC2.setText('0')
        self.LE_Spell_VampC2.setMaximumWidth(100)
        self.LE_Spell_VampC3=QtGui.QLineEdit()
        self.LE_Spell_VampC3.setReadOnly(True)
        self.LE_Spell_VampC3.setText('0')
        self.LE_Spell_VampC3.setMaximumWidth(100)
        self.LE_Spell_VampC4=QtGui.QLineEdit()
        self.LE_Spell_VampC4.setReadOnly(True)
        self.LE_Spell_VampC4.setText('0')
        self.LE_Spell_VampC4.setMaximumWidth(100)
        
        self.L_Spell_Vamp.addWidget(self.LBL_Spell_Vamp)
        self.L_Spell_Vamp.addWidget(self.LE_Spell_VampC1)
        self.L_Spell_Vamp.addWidget(self.LE_Spell_VampC2)
        self.L_Spell_Vamp.addWidget(self.LE_Spell_VampC3)
        self.L_Spell_Vamp.addWidget(self.LE_Spell_VampC4)
        self.L_Spell_Vamp.addStretch()
        # Life_Steal
        self.L_Life_Steal=QtGui.QVBoxLayout()
        self.LBL_Life_Steal=QtGui.QLabel('Life Steal\n')
        self.LE_Life_StealC1=QtGui.QLineEdit()
        self.LE_Life_StealC1.setReadOnly(True)
        self.LE_Life_StealC1.setText('0')
        self.LE_Life_StealC1.setMaximumWidth(100)
        self.LE_Life_StealC2=QtGui.QLineEdit()
        self.LE_Life_StealC2.setReadOnly(True)
        self.LE_Life_StealC2.setText('0')
        self.LE_Life_StealC2.setMaximumWidth(100)
        self.LE_Life_StealC3=QtGui.QLineEdit()
        self.LE_Life_StealC3.setReadOnly(True)
        self.LE_Life_StealC3.setText('0')
        self.LE_Life_StealC3.setMaximumWidth(100)
        self.LE_Life_StealC4=QtGui.QLineEdit()
        self.LE_Life_StealC4.setReadOnly(True)
        self.LE_Life_StealC4.setText('0')
        self.LE_Life_StealC4.setMaximumWidth(100)
        self.L_Life_Steal.addWidget(self.LBL_Life_Steal)
        self.L_Life_Steal.addWidget(self.LE_Life_StealC1)
        self.L_Life_Steal.addWidget(self.LE_Life_StealC2)
        self.L_Life_Steal.addWidget(self.LE_Life_StealC3)
        self.L_Life_Steal.addWidget(self.LE_Life_StealC4)
        self.L_Life_Steal.addStretch()
        # Cooldown_Reduction
        self.L_Cooldown_Reduction=QtGui.QVBoxLayout()
        self.LBL_Cooldown_Reduction=QtGui.QLabel('Cooldown\nReduction')
        self.LE_Cooldown_ReductionC1=QtGui.QLineEdit()
        self.LE_Cooldown_ReductionC1.setReadOnly(True)
        self.LE_Cooldown_ReductionC1.setText('0')
        self.LE_Cooldown_ReductionC1.setMaximumWidth(100)
        self.LE_Cooldown_ReductionC2=QtGui.QLineEdit()
        self.LE_Cooldown_ReductionC2.setReadOnly(True)
        self.LE_Cooldown_ReductionC2.setText('0')
        self.LE_Cooldown_ReductionC2.setMaximumWidth(100)
        self.LE_Cooldown_ReductionC3=QtGui.QLineEdit()
        self.LE_Cooldown_ReductionC3.setReadOnly(True)
        self.LE_Cooldown_ReductionC3.setText('0')
        self.LE_Cooldown_ReductionC3.setMaximumWidth(100)
        self.LE_Cooldown_ReductionC4=QtGui.QLineEdit()
        self.LE_Cooldown_ReductionC4.setReadOnly(True)
        self.LE_Cooldown_ReductionC4.setText('0')
        self.LE_Cooldown_ReductionC4.setMaximumWidth(100)
        
        self.L_Cooldown_Reduction.addWidget(self.LBL_Cooldown_Reduction)
        self.L_Cooldown_Reduction.addWidget(self.LE_Cooldown_ReductionC1)
        self.L_Cooldown_Reduction.addWidget(self.LE_Cooldown_ReductionC2)
        self.L_Cooldown_Reduction.addWidget(self.LE_Cooldown_ReductionC3)
        self.L_Cooldown_Reduction.addWidget(self.LE_Cooldown_ReductionC4)
        self.L_Cooldown_Reduction.addStretch()
        # Armor_Penetration        # Armor_Penetration
        self.L_Armor_Penetration=QtGui.QVBoxLayout()
        self.LBL_Armor_Penetration=QtGui.QLabel('Armor\nPenetration')
        self.LE_Armor_PenetrationC1=QtGui.QLineEdit()
        self.LE_Armor_PenetrationC1.setReadOnly(True)
        self.LE_Armor_PenetrationC1.setText('0')
        self.LE_Armor_PenetrationC1.setMaximumWidth(100)
        self.LE_Armor_PenetrationC2=QtGui.QLineEdit()
        self.LE_Armor_PenetrationC2.setReadOnly(True)
        self.LE_Armor_PenetrationC2.setText('0')
        self.LE_Armor_PenetrationC2.setMaximumWidth(100)
        self.LE_Armor_PenetrationC3=QtGui.QLineEdit()
        self.LE_Armor_PenetrationC3.setReadOnly(True)
        self.LE_Armor_PenetrationC3.setText('0')
        self.LE_Armor_PenetrationC3.setMaximumWidth(100)
        self.LE_Armor_PenetrationC4=QtGui.QLineEdit()
        self.LE_Armor_PenetrationC4.setReadOnly(True)
        self.LE_Armor_PenetrationC4.setText('0')
        self.LE_Armor_PenetrationC4.setMaximumWidth(100)
        
        self.L_Armor_Penetration.addWidget(self.LBL_Armor_Penetration)
        self.L_Armor_Penetration.addWidget(self.LE_Armor_PenetrationC1)
        self.L_Armor_Penetration.addWidget(self.LE_Armor_PenetrationC2)
        self.L_Armor_Penetration.addWidget(self.LE_Armor_PenetrationC3)
        self.L_Armor_Penetration.addWidget(self.LE_Armor_PenetrationC4)
        self.L_Armor_Penetration.addStretch()
        # Magic_Penetration
        self.L_Magic_Penetration=QtGui.QVBoxLayout()
        self.LBL_Magic_Penetration=QtGui.QLabel('Magic\nPenetration')
        self.LE_Magic_PenetrationC1=QtGui.QLineEdit()
        self.LE_Magic_PenetrationC1.setReadOnly(True)
        self.LE_Magic_PenetrationC1.setText('0')
        self.LE_Magic_PenetrationC1.setMaximumWidth(100)
        self.LE_Magic_PenetrationC2=QtGui.QLineEdit()
        self.LE_Magic_PenetrationC2.setReadOnly(True)
        self.LE_Magic_PenetrationC2.setText('0')
        self.LE_Magic_PenetrationC2.setMaximumWidth(100)
        self.LE_Magic_PenetrationC3=QtGui.QLineEdit()
        self.LE_Magic_PenetrationC3.setReadOnly(True)
        self.LE_Magic_PenetrationC3.setText('0')
        self.LE_Magic_PenetrationC3.setMaximumWidth(100)
        self.LE_Magic_PenetrationC4=QtGui.QLineEdit()
        self.LE_Magic_PenetrationC4.setReadOnly(True)
        self.LE_Magic_PenetrationC4.setText('0')
        self.LE_Magic_PenetrationC4.setMaximumWidth(100)
        self.L_Magic_Penetration.addWidget(self.LBL_Magic_Penetration)
        self.L_Magic_Penetration.addWidget(self.LE_Magic_PenetrationC1)
        self.L_Magic_Penetration.addWidget(self.LE_Magic_PenetrationC2)
        self.L_Magic_Penetration.addWidget(self.LE_Magic_PenetrationC3)
        self.L_Magic_Penetration.addWidget(self.LE_Magic_PenetrationC4)
        self.L_Magic_Penetration.addStretch()
        # Critical_Strike_Chance
        self.L_Critical_Strike_Chance=QtGui.QVBoxLayout()
        self.LBL_Critical_Strike_Chance=QtGui.QLabel('Critical\nStrike Chance')
        self.LE_Critical_Strike_ChanceC1=QtGui.QLineEdit()
        self.LE_Critical_Strike_ChanceC1.setReadOnly(True)
        self.LE_Critical_Strike_ChanceC1.setText('0')
        self.LE_Critical_Strike_ChanceC1.setMaximumWidth(100)
        self.LE_Critical_Strike_ChanceC2=QtGui.QLineEdit()
        self.LE_Critical_Strike_ChanceC2.setReadOnly(True)
        self.LE_Critical_Strike_ChanceC2.setText('0')
        self.LE_Critical_Strike_ChanceC2.setMaximumWidth(100)
        self.LE_Critical_Strike_ChanceC3=QtGui.QLineEdit()
        self.LE_Critical_Strike_ChanceC3.setReadOnly(True)
        self.LE_Critical_Strike_ChanceC3.setText('0')
        self.LE_Critical_Strike_ChanceC3.setMaximumWidth(100)
        self.LE_Critical_Strike_ChanceC4=QtGui.QLineEdit()
        self.LE_Critical_Strike_ChanceC4.setReadOnly(True)
        self.LE_Critical_Strike_ChanceC4.setText('0')
        self.LE_Critical_Strike_ChanceC4.setMaximumWidth(100)
        self.L_Critical_Strike_Chance.addWidget(self.LBL_Critical_Strike_Chance)
        self.L_Critical_Strike_Chance.addWidget(self.LE_Critical_Strike_ChanceC1)
        self.L_Critical_Strike_Chance.addWidget(self.LE_Critical_Strike_ChanceC2)
        self.L_Critical_Strike_Chance.addWidget(self.LE_Critical_Strike_ChanceC3)
        self.L_Critical_Strike_Chance.addWidget(self.LE_Critical_Strike_ChanceC4)
        self.L_Critical_Strike_Chance.addStretch()
        # put into masterlayout
        # first row
        self.MasterLayout.addLayout(self.L_Health,0,0,1,1)
        self.MasterLayout.addLayout(self.L_Health_Regen_per_5_seconds,0,1,1,1)
        self.MasterLayout.addLayout(self.L_Mana,0,2,1,1)
        self.MasterLayout.addLayout(self.L_Mana_Regen_per_5_seconds,0,3,1,1)
        # second row
        self.MasterLayout.addLayout(self.L_Attack_Damage,1,0,1,1)
        self.MasterLayout.addLayout(self.L_Armor,1,1,1,1)
        self.MasterLayout.addLayout(self.L_Ability_Power,1,2,1,1)
        self.MasterLayout.addLayout(self.L_Magic_Resist,1,3,1,1)
        # third row
        self.MasterLayout.addLayout(self.L_Movement_Speed,2,0,1,1)
        self.MasterLayout.addLayout(self.L_Attack_Speed,2,1,1,1)
        self.MasterLayout.addLayout(self.L_Critical_Strike_Chance,2,2,1,1)
        self.MasterLayout.addLayout(self.L_Cooldown_Reduction,2,3,1,1)
        # fourth row
        self.MasterLayout.addLayout(self.L_Armor_Penetration,3,0,1,1)
        self.MasterLayout.addLayout(self.L_Magic_Penetration,3,1,1,1)
        self.MasterLayout.addLayout(self.L_Life_Steal,3,2,1,1)
        self.MasterLayout.addLayout(self.L_Spell_Vamp,3,3,1,1)
        # fifth (spacer)
        self.MasterLayout.setRowStretch(4,1)

    def setChamp(self,Champ):
        self.Champ = Champ
        self.UpdateStats()

    def UpdateStatsC1(self):
        Champ=self.parent.Slot1.Champ
        self.LE_HealthC1.setText(str(Champ.Health))
        self.LE_ManaC1.setText(str(Champ.Mana))
        self.LE_Health_Regen_per_5_secondsC1.setText("%s (%s)" % (str(Champ.Health_Regen_per_5_seconds),str(Champ.Health_Regen_per_5_seconds/5.0)))
        self.LE_Mana_Regen_per_5_secondsC1.setText("%s (%s)" % (str(Champ.Mana_Regen_per_5_seconds),str(Champ.Mana_Regen_per_5_seconds/5.0)))
        self.LE_Attack_DamageC1.setText(str(Champ.Attack_Damage))
        self.LE_ArmorC1.setText(str(Champ.Armor))
        self.LE_Ability_PowerC1.setText(str(Champ.Ability_Power))
        self.LE_Magic_ResistC1.setText(str(Champ.Magic_Resist))
        self.LE_Magic_PenetrationC1.setText("%s | %s" % (str(Champ.Magic_Penetration_Flat),str(Champ.Magic_Penetration_Percentage)+"%"))
        self.LE_Armor_PenetrationC1.setText("%s | %s" % (str(Champ.Armor_Penetration_Flat),str(Champ.Armor_Penetration_Percentage)+"%"))
        self.LE_Spell_VampC1.setText(str(Champ.Spell_Vamp))
        self.LE_Life_StealC1.setText(str(Champ.Life_Steal))
        self.LE_Movement_SpeedC1.setText(str(Champ.Movement_Speed))
        self.LE_Critical_Strike_ChanceC1.setText(str(Champ.Critical_Strike_Chance))
        self.LE_Attack_SpeedC1.setText(str(Champ.Attack_Speed))
        self.LE_Cooldown_ReductionC1.setText(str(Champ.Cooldown_Reduction))

    def UpdateStatsC2(self):
        Champ=self.parent.Slot2.Champ
        self.LE_HealthC2.setText(str(Champ.Health))
        self.LE_ManaC2.setText(str(Champ.Mana))
        self.LE_Health_Regen_per_5_secondsC2.setText("%s (%s)" % (str(Champ.Health_Regen_per_5_seconds),str(Champ.Health_Regen_per_5_seconds/5.0)))
        self.LE_Mana_Regen_per_5_secondsC2.setText("%s (%s)" % (str(Champ.Mana_Regen_per_5_seconds),str(Champ.Mana_Regen_per_5_seconds/5.0)))
        self.LE_Attack_DamageC2.setText(str(Champ.Attack_Damage))
        self.LE_ArmorC2.setText(str(Champ.Armor))
        self.LE_Ability_PowerC2.setText(str(Champ.Ability_Power))
        self.LE_Magic_ResistC2.setText(str(Champ.Magic_Resist))
        self.LE_Magic_PenetrationC2.setText("%s | %s" % (str(Champ.Magic_Penetration_Flat),str(Champ.Magic_Penetration_Percentage)+"%"))
        self.LE_Armor_PenetrationC2.setText("%s | %s" % (str(Champ.Armor_Penetration_Flat),str(Champ.Armor_Penetration_Percentage)+"%"))
        self.LE_Spell_VampC2.setText(str(Champ.Spell_Vamp))
        self.LE_Life_StealC2.setText(str(Champ.Life_Steal))
        self.LE_Movement_SpeedC2.setText(str(Champ.Movement_Speed))
        self.LE_Critical_Strike_ChanceC2.setText(str(Champ.Critical_Strike_Chance))
        self.LE_Attack_SpeedC2.setText(str(Champ.Attack_Speed))
        self.LE_Cooldown_ReductionC2.setText(str(Champ.Cooldown_Reduction))
        
    def UpdateStatsC3(self):
        Champ=self.parent.Slot3.Champ
        self.LE_HealthC3.setText(str(Champ.Health))
        self.LE_ManaC3.setText(str(Champ.Mana))
        self.LE_Health_Regen_per_5_secondsC3.setText("%s (%s)" % (str(Champ.Health_Regen_per_5_seconds),str(Champ.Health_Regen_per_5_seconds/5.0)))
        self.LE_Mana_Regen_per_5_secondsC3.setText("%s (%s)" % (str(Champ.Mana_Regen_per_5_seconds),str(Champ.Mana_Regen_per_5_seconds/5.0)))
        self.LE_Attack_DamageC3.setText(str(Champ.Attack_Damage))
        self.LE_ArmorC3.setText(str(Champ.Armor))
        self.LE_Ability_PowerC3.setText(str(Champ.Ability_Power))
        self.LE_Magic_ResistC3.setText(str(Champ.Magic_Resist))
        self.LE_Magic_PenetrationC3.setText("%s | %s" % (str(Champ.Magic_Penetration_Flat),str(Champ.Magic_Penetration_Percentage)+"%"))
        self.LE_Armor_PenetrationC3.setText("%s | %s" % (str(Champ.Armor_Penetration_Flat),str(Champ.Armor_Penetration_Percentage)+"%"))
        self.LE_Spell_VampC3.setText(str(Champ.Spell_Vamp))
        self.LE_Life_StealC3.setText(str(Champ.Life_Steal))
        self.LE_Movement_SpeedC3.setText(str(Champ.Movement_Speed))
        self.LE_Critical_Strike_ChanceC3.setText(str(Champ.Critical_Strike_Chance))
        self.LE_Cooldown_ReductionC3.setText(str(Champ.Cooldown_Reduction))
        self.LE_Attack_SpeedC3.setText(str(Champ.Attack_Speed))
        
    def UpdateStatsC4(self):
        Champ=self.parent.Slot4.Champ
        self.LE_HealthC4.setText(str(Champ.Health))
        self.LE_ManaC4.setText(str(Champ.Mana))
        self.LE_Health_Regen_per_5_secondsC4.setText("%s (%s)" % (str(Champ.Health_Regen_per_5_seconds),str(Champ.Health_Regen_per_5_seconds/5.0)))
        self.LE_Mana_Regen_per_5_secondsC4.setText("%s (%s)" % (str(Champ.Mana_Regen_per_5_seconds),str(Champ.Mana_Regen_per_5_seconds/5.0)))
        self.LE_Attack_DamageC4.setText(str(Champ.Attack_Damage))
        self.LE_ArmorC4.setText(str(Champ.Armor))
        self.LE_Ability_PowerC4.setText(str(Champ.Ability_Power))
        self.LE_Magic_ResistC4.setText(str(Champ.Magic_Resist))
        self.LE_Magic_PenetrationC4.setText("%s | %s" % (str(Champ.Magic_Penetration_Flat),str(Champ.Magic_Penetration_Percentage)+"%"))
        self.LE_Armor_PenetrationC4.setText("%s | %s" % (str(Champ.Armor_Penetration_Flat),str(Champ.Armor_Penetration_Percentage)+"%"))
        self.LE_Spell_VampC4.setText(str(Champ.Spell_Vamp))
        self.LE_Life_StealC4.setText(str(Champ.Life_Steal))
        self.LE_Movement_SpeedC4.setText(str(Champ.Movement_Speed))
        self.LE_Critical_Strike_ChanceC4.setText(str(Champ.Critical_Strike_Chance))
        self.LE_Attack_SpeedC4.setText(str(Champ.Attack_Speed))
        self.LE_Cooldown_ReductionC4.setText(str(Champ.Cooldown_Reduction))
